<template>
  <div class='container'>
    <div class='app-row m-20-t'>
      <span class="title bold width-100 align-right">上级分类:</span>
      <el-select v-model="type_value" palceholder="请选择文章类型" class="flex-1">
        <el-option
          v-for="item in category_type_list"
          :key="item.name + item.id"
          :value="item.name">
        </el-option>
      </el-select>
    </div>
    <div class='app-row m-50-t'>
      <span class="title bold width-100 align-right">名称:</span>
      <el-input class='flex-1' v-model="name_value" placeholder=""></el-input>
    </div>
    <div class='app-row m-30-t'>
      <span class="title bold width-120">首页系统分类:</span>
      <el-radio v-model="clear_radio" label="1">是</el-radio>     
      <el-radio v-model="clear_radio" label="2">否</el-radio> 
    </div>
    <div class='annotation m-10-t m-114-l'>
      <span>系统分类前台不展示，仅作为不可见的文章分类，主要是给管理员归纳文章使用的</span>
    </div>   
    <div class='app-row m-50-t'>
      <span class="title bold width-100 align-right">排序:</span>
      <el-input class='flex-1' v-model="rank_value"></el-input>
    </div>
    <div class='app-row m-20-t'>
      <span class="title bold width-100 align-right">SEO标题:</span>
      <el-input class='flex-1'></el-input>
    </div>
    <div class='app-row m-20-t'>
      <span class="title bold width-100 align-right">SEO关键词:</span>
      <el-input class='flex-1'></el-input>
    </div>
    <div class='app-row m-20-t'>
      <span class="title bold width-100 align-right">SEO描述:</span>
      <el-input class='flex-1' type="textarea" :rows='2'></el-input>
    </div>
    <div class="app-row j-c-c m-100-t">
      <el-button type="success" @click="add_button">确认添加</el-button>
    </div>
  </div>
</template>

<script>
  import article_page_category_request from "@/api/article_page_category_request"
  export default {
    name: 'article_page_category_add',
    data() {
      return {
        type_value: '',
        category_type_list: [],
        name_value: '',
        clear_radio: '1',
        rank_value: '',

      }
    },
    created() {

    },
    mounted() {
  
    },
    methods: {
      add_button() {
        if (this.name_value == '') {
          this.$message.error("请输入文章类型名称")
          return
        }
        let params = {
          name: this.name_value,
          parent_id: 0,
        }
        article_page_category_request.add_article_page_category(params, res=> {
          this.$router.push('/article_page/article_page_category')
        })
      },
    }
  }
</script>

<style scoped>
@import "~@/styles/layout.scss";

</style>